
import request from '@/utils/request'

// 新建
export function create(data) {
  return request({
    url: '/api/v1/menu',
    method: 'post',
    data: data
  })
}

// 获取分页list
export function getPageList(data) {
  return request({
    url: '/api/v1/job',
    method: 'get',
    params: data
  })
}

// 获取详情
export function menuDetailById(data) {
  return request({
    url: '/api/v1/menuDetailById',
    method: 'get',
    params: data
  })
}

// 获取分页list
export function getListTree() {
  return request({
    url: '/api/v1/menuTree',
    method: 'get'
  })
}

// 修改
export function update(data) {
  return request({
    url: '/api/v1/menu',
    method: 'put',
    data: data
  })
}

// 批量删除
export function deletesJob(data) {
  return request({
    url: '/api/v1/job',
    method: 'delete',
    data: data
  })
}

// 删除
export function deleteMenu(data) {
  return request({
    url: '/api/v1/menu/' + data,
    method: 'delete'
  })
}

// 获取菜单tree
export function getMenuTreeByRoleKey(data) {
  return request({
    url: '/api/v1/menuTree',
    method: 'post',
    data: data
  })
}
